package com.zbest.zpay.exchange.dal.dao;

import javax.annotation.Resource;

import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.stereotype.Service;

import com.zbest.common.lang.enums.BizCode;
import com.zbest.common.lang.exception.ZpayException;
import com.zbest.zpay.exchange.dal.mapper.BatchImportSerialMapper;
import com.zbest.zpay.exchange.dal.model.BatchImportSerialDO;

/**
 * Created by wenfeihu on 16/5/20.
 */
@Service("batchImportSerialDAO")
public class BatchImportSerialDAO {

    @Resource
    private BatchImportSerialMapper batchImportSerialMapper;

    public void insert(BatchImportSerialDO batchImportSerialDO) {

        try {
            batchImportSerialMapper.insert(batchImportSerialDO);
        } catch (DataIntegrityViolationException e) {
            throw new ZpayException(BizCode.DUPLICATED_ERROR);
        }

    }

}
